package com.xc.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.xc.common.ServerResponse;
import com.xc.dao.SiteTaskLogMapper;
import com.xc.pojo.SiteTaskLog;
import com.xc.service.ISiteTaskLogService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author mipha
 * @version 1.0
 * @date 2019/2/16 2:59 PM
 */
@Service("iSiteTaskLogService")
@Slf4j
public class SiteTaskLogServiceImpl implements ISiteTaskLogService {

    @Autowired
    SiteTaskLogMapper siteTaskLogMapper;


    @Override
    public ServerResponse<PageInfo> taskList(String taskType, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);

        List<SiteTaskLog> siteTaskLogs = siteTaskLogMapper.taskList(taskType);

        PageInfo pageInfo = new PageInfo(siteTaskLogs);

        return ServerResponse.createBySuccess(pageInfo);
    }



}
